const mysql = require('mysql');

let connection = mysql.createConnection({
    host:'127.0.0.1',
    user:'root',
    password:'',
    database: 'test'
});
connection.connect();
connection.query('SELECT * from users', (e, rows, fields) => {
    console.log(rows);
    console.log(fields);
});
connection.end();